<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1 {
            width: 400px;
            height: 400px;
            border: 1px solid red;
            perspective: 500px;
        }

        .box1 p {
            width: 100px;
            height: 100px;
            background: blueviolet;
            transition: 2s;
        }

        .box1:hover p {
            transform: rotateX(90deg);
        }

        .box2 {
            width: 400px;
            height: 400px;
            border: 1px solid red;
            perspective: 500px;
        }

        .box2 p {
            width: 100px;
            height: 100px;
            background: blueviolet;
            transition: 2s;
        }

        .box2:hover p {
            transform: rotateY(90deg);
        }

        .box3 {
            width: 400px;
            height: 400px;
            border: 1px solid red;
            perspective: 500px;
        }

        .box3 p {
            width: 100px;
            height: 100px;
            background: blueviolet;
            transition: 2s;
        }

        .box3:hover p {
            transform: rotateZ(90deg);
        }

        .box4 {
            width: 400px;
            height: 400px;
            border: 1px solid red;
            perspective: 500px;
        }

        .box4 p {
            width: 100px;
            height: 100px;
            background: blueviolet;
            transition: 2s;
        }

        .box4:hover p {
            transform: rotate3d(0, 1, 0, 90deg);
        }
    </style>
</head>

<body>
    1.x轴旋转效果
    <div class="box1">
        <p>x轴旋转</p>
    </div>
    2.y轴旋转效果
    <div class="box2">
        <p>y轴旋转</p>
    </div>
    3.z轴旋转效果
    <div class="box3">
        <p>z轴旋转</p>
    </div>
    3.3d旋转效果
    <div class="box4">
        <p>3d旋转</p>
    </div>
</body>

</html>